package arv;

public class Media {
	protected String title;
	protected int length;
	public static Media m;
	
	public Media(String title, int length){
		this.title = title;
		this.length = length;
	}
	//Singleton pattern
	public Media(){
		
	}
	
//	public static Media getMediaObject(){
//		if(m == null){
//			Media m1 = new Media();
//			m = m1;
//			return m;
//		}else{
//			return m;
//		}
//	}

	public String getTitle(){
		return title;
	}
	
	public int getLength(){
		return length;
	}
	
	public String toString(){
		return title + " " + length;
	}
	
	public void setTitle(String title){
		this.title = title;
	}
	
	public void run(){
		System.out.println("now playing media " + title);
	}
	
}
